﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Common;
using System.Data;
using DataAccessClasses;

namespace mobliebo
{
    class customer_info
    {
        iDAC DAC = DACFactory.GetDAC();
        private long _customer_id = -99;
        private string _customer_name = "";
        private string _address = "";
        private long _mobile = -99;
        private string _Email_id = "";
        private bool _is_deleted = false;
        public bool is_deleted
        {
            get
            {
                return _is_deleted;
            }
            set
            {
                _is_deleted = value;
            }
        }
        public long customer_id
        {
            get
            {
                return _customer_id;
            }
            set
            {
                _customer_id = value;
            }
        }
        public string customer_name
        {
            get
            {
                return _customer_name;
            }
            set
            {
                _customer_name = value;
            }
        }
        public string address
        {
            get
            {
                return _address;
            }
            set
            {
                _address = value;
            }
        }
        public long mobile
        {
            get
            {
                return _mobile;
            }
            set
            {
                _mobile = value;
            }
        }
        public string Email_id
        {
            get
            {
                return _Email_id;
            }
            set
            {
                _Email_id = value;
            }
        }
        public long SaveRecords()
        {
            try
            {
                DbParameter dbparam0 = DAC.Parameter("@customer_id", customer_id, DbType.Int64, ParameterDirection.Input);
                DbParameter dbparam1 = DAC.Parameter("@customer_name", customer_name, DbType.AnsiString, ParameterDirection.Input);
                DbParameter dbparam2 = DAC.Parameter("@address", address, DbType.Int64, ParameterDirection.Input);
                DbParameter dbparam3 = DAC.Parameter("@mobile", mobile, DbType.Int64, ParameterDirection.Input);
                DbParameter dbparam4 = DAC.Parameter("@Email_id", Email_id, DbType.AnsiString, ParameterDirection.Input);
                DbParameter dbparam5 = DAC.Parameter("@is_deleted", is_deleted, DbType.Boolean, ParameterDirection.Input);
                DbParameter[] dbparamcall = new DbParameter[] { dbparam0, dbparam1, dbparam2, dbparam3, dbparam4, dbparam5 };
                return DAC.Save("customer_info_save", dbparamcall);

            }
            catch (Exception ex)
            {
                long Result = -99;
            }
            return -99;
        }
        public DataTable GetRecords(long customer_id, string customer_name, string address, long mobile, string Email_id, bool is_deleted, string andor)
        {
            try
            {
                DbParameter dbparam0 = DAC.Parameter("@customer_id", customer_id, DbType.Int64, ParameterDirection.Input);
                DbParameter dbparam1 = DAC.Parameter("@customer_name", customer_name, DbType.AnsiString, ParameterDirection.Input);
                DbParameter dbparam2 = DAC.Parameter("@address", address, DbType.Int64, ParameterDirection.Input);
                DbParameter dbparam3 = DAC.Parameter("@mobile", mobile, DbType.Int64, ParameterDirection.Input);
                DbParameter dbparam4 = DAC.Parameter("@Email_id", Email_id, DbType.AnsiString, ParameterDirection.Input);
                DbParameter dbparam5 = DAC.Parameter("@is_deleted", is_deleted, DbType.Boolean, ParameterDirection.Input);
                DbParameter dbparam6 = DAC.Parameter("@andor", andor, DbType.AnsiString, ParameterDirection.Input);
                DbParameter[] dbparamcall = new DbParameter[] { dbparam0, dbparam1, dbparam2, dbparam3, dbparam4, dbparam5, dbparam6 };
                // return DAC.Save("customer_info_get", dbparamcall);
                DataTable dt1 = DAC.Select("customer_info_get", dbparamcall);
            }
            catch (Exception ex)
            {
                long Result = -99;
            }
            return null;

        }
    }
}
